package cn.lyh.iotmanage.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * @author lyh
 * @version 1.0
 * @since 2021/5/15
 */
@Data
@TableName(value = "emq_clients")
public class EmqClientsDao {
    /**
     * id值
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * clientid 唯一
     */
    @TableField(value = "clientid")
    private String clientid;

    /**
     * 上线时间
     */
    @TableField(value = "online_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date onlineAt;

    /**
     * 下线时间
     */
    @TableField(value = "offline_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date offlineAt;

    /**
     * 是否在线 状态值 0表示离线 1表示在线
     */
    @TableField(value = "is_online")
    private Boolean isOnline;

    /**
     * 更新时间
     */
    @TableField(value = "update_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateAt;

    /**
     * 创建时间
     */
    @TableField(value = "created_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createdAt;

    public static final String COL_ID = "id";

    public static final String COL_CLIENTID = "clientid";

    public static final String COL_ONLINE_AT = "online_at";

    public static final String COL_OFFLINE_AT = "offline_at";

    public static final String COL_IS_ONLINE = "is_online";

    public static final String COL_UPDATE_AT = "update_at";

    public static final String COL_CREATED_AT = "created_at";
}